package swa2.icecream.factory;

import swa2.icecream.IceCream;

public abstract class AbstractIceCreamFactory
{	
	protected int cherry = 0;
	protected int chocolate = 0;
	protected IceCream icecream;
	
	public abstract void createIceCream();

	public int isCherryOn() {
		return cherry;
	}

	public void addCherry(int cherry) {
		this.cherry += cherry;
		
		if(this.cherry < 0)
			this.cherry = 0;
	}

	public int isChocolateOn() {
		return chocolate;
	}

	public void addChocolate(int chocolate) {
		this.chocolate += chocolate;
		
		if(this.chocolate < 0)
			this.chocolate = 0;
	}
	
	public IceCream getIceCream()
	{
		IceCream ic = icecream;
		icecream = null;
		return ic;
	}
	
	
}
